package com.example.mapp;

import com.example.entity.check.SelfCheck;
import com.example.entity.check.SelfCheckResult;
import com.example.mapp.buildSql.SelfCheckMappSql;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface SelfCheckResultMapp {
    /**
     * 批量插入年检检查项结果
     * @param selfCheckResults
     * @return
     * @throws Exception
     */
    @InsertProvider(type = SelfCheckMappSql.class,method = "insertBatch")
    int add(@Param("list") List<SelfCheckResult> selfCheckResults) throws Exception;

    /**
     * 获取检查项结果
     */
    @SelectProvider(type = SelfCheckMappSql.class,method = "queryCheckResult")
    List<Map<String,Object>> queryCheckResult(SelfCheck selfCheck) throws Exception;

    /**
     * 更新年度自检报告
     */
    @Update("update self_check set report_url = #{reportUrl} where id = #{id}")
    int updateReportUrl(SelfCheck selfCheck) throws Exception;
}
